//2009/08/30 21:25:43
#include <iostream>
#include <string>
#include <vector>
#include <map>
#include <queue>
#include <sstream>
#include <algorithm>

using namespace std;

class LeastMajorityMultiple
{
public:
    int leastMajorityMultiple(int a, int b, int c, int d, int e)
    {
		for(int i=min(a, min(min(b,c), min(d,e))); ; i++)
		{
			int temp = 0;
			if(i%a==0) temp++;
			if(i%b==0) temp++;
			if(i%c==0) temp++;
			if(i%d==0) temp++;
			if(i%e==0) temp++;
			if(temp >=3) return i;
		}
    }
};
